<?php

/* 
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
    class adminmodel extends CI_Model{

        function __construct()
        {
            parent::__construct();
			
        }
        function getAllRole()
        {
            $q = $this->db->get('v_admin_role');
            if($q->num_rows > 0 )
            {
                foreach ($q ->result() as $row )
                {
                    $data[] = $row ;
                }
            }
            return $data;
            /*include(APPPATH.'config/database'.EXT);            
            
            mysql_connect($db['default']['hostname'], $db['default']['username'], $db['default']['password']) or die(mysql_error());
            mysql_select_db($db['default']['database']) or die(mysql_error());
			
            // Retrieve all the data from the "example" table
            $result = mysql_query("SELECT * FROM v_admin_role")
            or die(mysql_error());  

            // store the record of the "example" table into $row
            $data_array = array();
            while ($row = mysql_fetch_object($result)) {
                $data_array[] = $row;
            }
			print_r($data_array);
            // Print out the contents of the entry 
            return $data_array;*/
        }
    }
?>